(define-module (Z572 services input-method)
  #:use-module (gnu services)
  #:use-module (srfi srfi-26)
  #:use-module (gnu home-services)
  #:use-module (gnu packages fcitx5))

(define-public home-fcitx5-server-type
  (service-type
   (name 'home-fcitx5)
   (extensions
    (list
     (service-extension
      home-profile-service-type
      (const (list fcitx5
                   fcitx5-chinese-addons
                   fcitx5-configtool
                   fcitx5-gtk
                   fcitx5-material-color-theme)))
     (service-extension
      home-environment-variables-service-type
      (const
       `(,@(map (cut cons <> "fcitx")
                '("QT_IM_MODULE"
                  "GTK_IM_MODULE"
                  "INPUT_METHOD"
                  "SDL_IM_MODULE"))
         ("XMODIFIERS" . "@im=fcitx")
         ("GUIX_GTK3_IM_MODULE_FILE"
          . "$GUIX_GTK3_PATH/3.0.0/immodules-gtk3.cache")
         ("GUIX_GTK2_IM_MODULE_FILE"
          . "$GUIX_GTK3_PATH/2.10.0/immodules-gtk2.cache"))))))
   (default-value #f)))
